﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.PutniNalogStavkaDnevnica"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class PutniNalogStavkaDnevnicaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// ComboBox for the IDPutniNalog property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDPutniNalog;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDPutniNalog property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDPutniNalogLabel;
		
		/// <summary>
		/// DataTimePicker for the Pocetak property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxPocetak;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Pocetak property.
		/// </summary>
		protected System.Windows.Forms.Label uxPocetakLabel;
		
		/// <summary>
		/// DataTimePicker for the Kraj property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxKraj;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Kraj property.
		/// </summary>
		protected System.Windows.Forms.Label uxKrajLabel;
		
		/// <summary>
		/// ComboBox for the IDDnevnica property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDDnevnica;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDDnevnica property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDDnevnicaLabel;
		
		/// <summary>
		/// TextBox for the DnevnicaIznos property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxDnevnicaIznos;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the DnevnicaIznos property.
		/// </summary>
		protected System.Windows.Forms.Label uxDnevnicaIznosLabel;
		
		/// <summary>
		/// TextBox for the OdobreniPostotakDnevnice property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxOdobreniPostotakDnevnice;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the OdobreniPostotakDnevnice property.
		/// </summary>
		protected System.Windows.Forms.Label uxOdobreniPostotakDnevniceLabel;
		
		/// <summary>
		/// TextBox for the Iznos property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIznos;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Iznos property.
		/// </summary>
		protected System.Windows.Forms.Label uxIznosLabel;
		
		/// <summary>
		/// ComboBox for the IDKontoDnevnice property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDKontoDnevnice;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDKontoDnevnice property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDKontoDnevniceLabel;
		
		/// <summary>
		/// TextBox for the IDBlagajnaStavka property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIDBlagajnaStavka;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDBlagajnaStavka property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDBlagajnaStavkaLabel;
		#endregion
		
		#region Main entity
		private Entities.PutniNalogStavkaDnevnica _PutniNalogStavkaDnevnica;
		/// <summary>
		/// Gets or sets the <see cref="Entities.PutniNalogStavkaDnevnica"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.PutniNalogStavkaDnevnica"/> instance.</value>
		public Entities.PutniNalogStavkaDnevnica PutniNalogStavkaDnevnica
		{
			get {return this._PutniNalogStavkaDnevnica;}
			set
			{
				this._PutniNalogStavkaDnevnica = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDPutniNalog.DataBindings.Clear();
			this.uxIDPutniNalog.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDPutniNalog", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxPocetak.DataBindings.Clear();
			this.uxPocetak.DataBindings.Add("Value", this.uxBindingSource, "Pocetak", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxKraj.DataBindings.Clear();
			this.uxKraj.DataBindings.Add("Value", this.uxBindingSource, "Kraj", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDDnevnica.DataBindings.Clear();
			this.uxIDDnevnica.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDDnevnica", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxDnevnicaIznos.DataBindings.Clear();
			this.uxDnevnicaIznos.DataBindings.Add("Text", this.uxBindingSource, "DnevnicaIznos", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxOdobreniPostotakDnevnice.DataBindings.Clear();
			this.uxOdobreniPostotakDnevnice.DataBindings.Add("Text", this.uxBindingSource, "OdobreniPostotakDnevnice", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIznos.DataBindings.Clear();
			this.uxIznos.DataBindings.Add("Text", this.uxBindingSource, "Iznos", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDKontoDnevnice.DataBindings.Clear();
			this.uxIDKontoDnevnice.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDKontoDnevnice", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDBlagajnaStavka.DataBindings.Clear();
			this.uxIDBlagajnaStavka.DataBindings.Add("Text", this.uxBindingSource, "IDBlagajnaStavka", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="PutniNalogStavkaDnevnicaEditControlBase"/> class.
		/// </summary>
		public PutniNalogStavkaDnevnicaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_PutniNalogStavkaDnevnica != null) _PutniNalogStavkaDnevnica.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxIDPutniNalog = new System.Windows.Forms.ComboBox();
			uxIDPutniNalogLabel = new System.Windows.Forms.Label();
			this.uxPocetak = new System.Windows.Forms.DateTimePicker();
			uxPocetakLabel = new System.Windows.Forms.Label();
			this.uxKraj = new System.Windows.Forms.DateTimePicker();
			uxKrajLabel = new System.Windows.Forms.Label();
			this.uxIDDnevnica = new System.Windows.Forms.ComboBox();
			uxIDDnevnicaLabel = new System.Windows.Forms.Label();
			this.uxDnevnicaIznos = new System.Windows.Forms.TextBox();
			uxDnevnicaIznosLabel = new System.Windows.Forms.Label();
			this.uxOdobreniPostotakDnevnice = new System.Windows.Forms.TextBox();
			uxOdobreniPostotakDnevniceLabel = new System.Windows.Forms.Label();
			this.uxIznos = new System.Windows.Forms.TextBox();
			uxIznosLabel = new System.Windows.Forms.Label();
			this.uxIDKontoDnevnice = new System.Windows.Forms.ComboBox();
			uxIDKontoDnevniceLabel = new System.Windows.Forms.Label();
			this.uxIDBlagajnaStavka = new System.Windows.Forms.TextBox();
			uxIDBlagajnaStavkaLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxIDPutniNalogLabel
			//
			this.uxIDPutniNalogLabel.Text = "IDPutniNalog:";
			this.uxIDPutniNalogLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDPutniNalogLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDPutniNalogLabel);			
			//
			// uxIDPutniNalog
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDPutniNalog);
			this.uxIDPutniNalog.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDPutniNalog);
			//
			// uxPocetakLabel
			//
			this.uxPocetakLabel.Text = "Pocetak:";
			this.uxPocetakLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxPocetakLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxPocetakLabel);			
			//
			// uxPocetak
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxPocetak);
			this.uxPocetak.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxPocetak);
			//
			// uxKrajLabel
			//
			this.uxKrajLabel.Text = "Kraj:";
			this.uxKrajLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxKrajLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxKrajLabel);			
			//
			// uxKraj
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxKraj);
			this.uxKraj.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxKraj);
			//
			// uxIDDnevnicaLabel
			//
			this.uxIDDnevnicaLabel.Text = "IDDnevnica:";
			this.uxIDDnevnicaLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxIDDnevnicaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDDnevnicaLabel);			
			//
			// uxIDDnevnica
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDDnevnica);
			this.uxIDDnevnica.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxIDDnevnica);
			//
			// uxDnevnicaIznosLabel
			//
			this.uxDnevnicaIznosLabel.Text = "DnevnicaIznos:";
			this.uxDnevnicaIznosLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxDnevnicaIznosLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxDnevnicaIznosLabel);			
			//
			// uxDnevnicaIznos
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxDnevnicaIznos);
			this.uxDnevnicaIznos.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxDnevnicaIznos);
			//
			// uxOdobreniPostotakDnevniceLabel
			//
			this.uxOdobreniPostotakDnevniceLabel.Text = "OdobreniPostotakDnevnice:";
			this.uxOdobreniPostotakDnevniceLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxOdobreniPostotakDnevniceLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxOdobreniPostotakDnevniceLabel);			
			//
			// uxOdobreniPostotakDnevnice
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxOdobreniPostotakDnevnice);
			this.uxOdobreniPostotakDnevnice.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxOdobreniPostotakDnevnice);
			//
			// uxIznosLabel
			//
			this.uxIznosLabel.Text = "Iznos:";
			this.uxIznosLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxIznosLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIznosLabel);			
			//
			// uxIznos
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIznos);
			this.uxIznos.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxIznos);
			//
			// uxIDKontoDnevniceLabel
			//
			this.uxIDKontoDnevniceLabel.Text = "IDKontoDnevnice:";
			this.uxIDKontoDnevniceLabel.Location = new System.Drawing.Point(3, 208);
			this.Controls.Add(this.uxIDKontoDnevniceLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoDnevniceLabel);			
			//
			// uxIDKontoDnevnice
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDKontoDnevnice);
			this.uxIDKontoDnevnice.Location = new System.Drawing.Point(160, 208);
			this.Controls.Add(this.uxIDKontoDnevnice);
			//
			// uxIDBlagajnaStavkaLabel
			//
			this.uxIDBlagajnaStavkaLabel.Text = "IDBlagajnaStavka:";
			this.uxIDBlagajnaStavkaLabel.Location = new System.Drawing.Point(3, 234);
			this.Controls.Add(this.uxIDBlagajnaStavkaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDBlagajnaStavkaLabel);			
			//
			// uxIDBlagajnaStavka
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDBlagajnaStavka);
			this.uxIDBlagajnaStavka.Location = new System.Drawing.Point(160, 234);
			this.Controls.Add(this.uxIDBlagajnaStavka);
			//
			// uxIDDnevnica
			//				
			this.uxIDDnevnica.DisplayMember = "Naziv";	
			this.uxIDDnevnica.ValueMember = "ID";	
			//
			// uxIDKontoDnevnice
			//				
			this.uxIDKontoDnevnice.DisplayMember = "Sifra";	
			this.uxIDKontoDnevnice.ValueMember = "ID";	
			//
			// uxIDPutniNalog
			//				
			this.uxIDPutniNalog.DisplayMember = "Oznaka";	
			this.uxIDPutniNalog.ValueMember = "ID";	
			// 
			// PutniNalogStavkaDnevnicaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "PutniNalogStavkaDnevnicaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Dnevnica> _IDDnevnicaList;
		
		/// <summary>
		/// The ComboBox associated with the IDDnevnica property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Dnevnica> IDDnevnicaList
		{
			get {return _IDDnevnicaList;}
			set 
			{
				this._IDDnevnicaList = value;
				this.uxIDDnevnica.DataSource = null;
				this.uxIDDnevnica.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDDnevnicaList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDDnevnica property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDDnevnicaList
		{
			get { return _allowNewItemInIDDnevnicaList;}
			set
			{
				this._allowNewItemInIDDnevnicaList = value;
				this.uxIDDnevnica.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.Konto> _IDKontoDnevniceList;
		
		/// <summary>
		/// The ComboBox associated with the IDKontoDnevnice property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Konto> IDKontoDnevniceList
		{
			get {return _IDKontoDnevniceList;}
			set 
			{
				this._IDKontoDnevniceList = value;
				this.uxIDKontoDnevnice.DataSource = null;
				this.uxIDKontoDnevnice.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDKontoDnevniceList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDKontoDnevnice property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDKontoDnevniceList
		{
			get { return _allowNewItemInIDKontoDnevniceList;}
			set
			{
				this._allowNewItemInIDKontoDnevniceList = value;
				this.uxIDKontoDnevnice.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.PutniNalog> _IDPutniNalogList;
		
		/// <summary>
		/// The ComboBox associated with the IDPutniNalog property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.PutniNalog> IDPutniNalogList
		{
			get {return _IDPutniNalogList;}
			set 
			{
				this._IDPutniNalogList = value;
				this.uxIDPutniNalog.DataSource = null;
				this.uxIDPutniNalog.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDPutniNalogList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDPutniNalog property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDPutniNalogList
		{
			get { return _allowNewItemInIDPutniNalogList;}
			set
			{
				this._allowNewItemInIDPutniNalogList = value;
				this.uxIDPutniNalog.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
